﻿using System;

using Facebook.Schema;

using SBPweb.PlAzureNet.Shared.Library.Actors;

using SBPweb.PlAzureNet.Client.Library.Social.Actors;
using SBPweb.PlAzureNet.Client.Library.Services.Data;

namespace SBPweb.PlAzureNet.Client.Modules.Facebook.API
{

    public class User : UserBase
    {

        #region Fields

        private user user;

        #endregion

        #region Constructor logic

        internal User(user user)
        {
            this.user = user;
        }
        
        #endregion

        #region Properties
        
        public override string UserId
        {
            get
            {
                if (user.uid.HasValue)
                {
                    return user.uid.Value.ToString();
                }
                return null;
            }
        }

        public override string FullName
        {
            get
            {
                return user.name;
            }
        }

        public override string FirstName
        {
            get
            {
                return user.first_name;
            }
        }

        public override string LastName
        {
            get
            {
                return user.last_name;
            }
        }

        public override string EMail
        {
            get
            {
                return user.proxied_email;
            }
        }

        public override Uri AvatarUri
        {
            get
            {
                return new Uri(user.pic);
            }
        }

        public override Genders Gender
        {
            get
            {
                return (Genders)Enum.Parse(typeof(Genders), user.sex, true);
            }
        }

        #endregion

        #region Methods


        #endregion

    }

}